package com.quasar.hpatient.presenter;
import com.quasar.hpatient.model.medicalmodel.SevenDayInspectionData;
import com.quasar.hpatient.model.requestmodel.RequestModel;
import com.quasar.hpatient.onInterface.AnotherResultListener;
import com.quasar.hpatient.onInterface.viewInterface.UiInterface;


/**
 * author : 许建宏
 * Date: 2017/11/8 0008
 * View:绘制化验单item折线图
 */

public class SevenDayInspectionPresenter {

    private RequestModel requestModel;
    private UiInterface<SevenDayInspectionData> testrecordView;

    public SevenDayInspectionPresenter(UiInterface<SevenDayInspectionData> testrecordView) {
        this.requestModel = new RequestModel();
        this.testrecordView = testrecordView;
    }

    public void getSevenDayInspection(String endTime,String itemName,String typr){
        requestModel.SevenDayInspectionData(endTime, itemName,typr, new AnotherResultListener<SevenDayInspectionData>() {
            @Override
            public void onSuccess(SevenDayInspectionData data) {
                testrecordView.onViewSuccess(data);
            }

            @Override
            public void onError(String msg) {
                testrecordView.onViewError(msg);
            }

            @Override
            public void onRefreshUI() {
                testrecordView.onViewRefreshUI();
            }
        });
    }
}
